package com.example.domotique;

import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class Efface extends Activity {

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                /*setContentView(R.layout.activity_efface);
                
                // Ecouteur sur le bouton Nav
        Button vButtonWeb = (Button)findViewById(R.id.button1);
        vButtonWeb.setOnClickListener(new View.OnClickListener()
        {
                public void onClick(View v)
                {
                        ContentResolver cr = getContentResolver();
                    Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,
                            null, null, null, null);
                    while (cur.moveToNext()) {
                        try{
                            String lookupKey = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
                            Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookupKey);
                            System.out.println("The uri is " + uri.toString());
                            cr.delete(uri, null, null);
                        }
                        catch(Exception e)
                        {
                            System.out.println(e.getStackTrace());
                        }
                    }
                }
        });
        
        */
        }
}
